A PLC (Programmable Logic Controller) is, for example, configured by a plurality of units such as a CPU (Central Processing Unit) including a microprocessor for executing a user program, and an IO (Input Output) unit responsible for signal input from external switches and sensors and signal output to external relays and actuators. When the PLC executes a control operation, the data is exchanged among the units for every execution cycle of the user program via a PLC system bus and/or field network.
The control of operations of machineries, facilities, and the like sometimes include a motion control for controlling the motion of a motor. Conventionally, in such motion control, control processing (execution of motion computation program) for periodically outputting a command value to a motor driver, which drives a motor, is typically carried out in a motion controller arranged separate from the PLC.
However, increase in speed of the microprocessor and the communication network is progressing in the field of information technology. Thus, not only the user program, but also the motion computation program can be executed in one microprocessor in the PLC using such techniques.
Below, using a PLC described in Patent Citation 1, a basic configuration and basic function will be described.
The PLC described in Patent Citation 1 includes a configuration of processing a motion control function of controlling a motor and a PLC function of executing a sequence computation (user program) with one CPU. More specifically, the PLC described in Patent Citation 1 includes executing “fixed-cycle motion control processing and each axis processing” and “high speed sequence processing” for every cycle, and furthermore, executing “low speed sequence processing” or “non-fixed cycle motion control processing” in the remaining time of the cycle.
In addition, the PLC in Patent Citation 1 realizes an electronic CAM in the motion control. The electronic CAM realizes the operation of a mechanical CAM in electronic control, so that tooling change of the CAM, fine-tuning of the CAM shape, and the like can be freely and easily carried out.
More specifically, the PLC, using the CAM table, calculates the phase of the master axis for every control cycle and outputs command values corresponding to the displacement of the phase of the slave axis to the motor. The CAM table is a table in which phases of the master axis (one of the position of the encoder for the full closed loop control, the command positions of the servo driver and the virtual servo driver, as well as the feedback positions of the encoder, the servo driver, and the virtual servo driver) and displacements of the slave axis of the electronic CAM are associated with each other.
Furthermore in the electronic CAM technology, with the change of product items and a tooling change, it is desired to make it possible to change the CAM operations. This “change of the CAM operations” includes, not only changing the CAM tables defining the CAM operation, but also correcting or adjusting the CAM operation defined by the CAM table considering the effect of the mechanical error or the like.
According to the PLC described in the Patent Citation 1, the CAM operation is changed by switching the CAM table which is being used for computation. Specifically, a plurality of CAM table are stored in the memory, and the CPU unit switches the CAM table to be used for computation when the instruction about switching the CAM tables due to the change of the one to be controlled.
According to the PLC described in the Patent Citation 2, the CAM operation is changed by rewriting values of the CAM table. Specifically, CPU unit rewrites the values of the CAM table based on the dedicated instruction.